<template>
  <h1>下拉选框组件</h1>
  <el-select placeholder="请选择你喜欢的城市" style="width:50%;" v-model="city">
    <el-option label="三亚" value="sy"></el-option>
    <el-option label="大理" value="dl"></el-option>
    <el-option label="喀什" value="ks"></el-option>
    <el-option label="大同" value="dt"></el-option>
  </el-select>
  <h4>您选择的值是:{{city}}</h4>
</template>

<script setup>
import {ref} from "vue";

//定义变量用来保存用户选的值
const city = ref('dl');
</script>

<style scoped>

</style>